﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DalatCooking.Core;
using DalatCooking.Core.Helper;
public partial class admin_Settings_FileFolder :System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
       
    }
    protected override void OnInit(EventArgs e)
    {
        if (!IsPostBack)
        {
            Person p = Session.GetPersonLogged();
            if (!p.IsInRole("SuperUser"))
                Response.Redirect("/admin/accessdeny.aspx");
        }
        LoadSettings();
        base.OnInit(e);
    }
    void LoadSettings()
    {
        /*
        txtRootFolder.Text = Setting.String("file.rootfolder");
        txtFileFolder.Text = Setting.String("file.filefolder");
        txtImageFolder.Text = Setting.String("file.imagefolder");
        txtVideoFolder.Text = Setting.String("file.videofolder");
        txtMp3Folder.Text = Setting.String("file.mp3folder");
        txtFlashFolder.Text = Setting.String("file.flashfolder");
        txtFileExt.Text = Setting.String("file.allowfileext");
        txtImageExt.Text = Setting.String("file.allowimageext");
        txtVideoExt.Text = Setting.String("file.allowvideoext");
        txtMp3Ext.Text = Setting.String("file.allowmp3ext");
        txtFileSize.Text = Setting.String("file.allowfilelenght");

        txtImageWidth.Text = Setting.String("image.width");
        txtImageHeight.Text = Setting.String("image.height");
        * 
         * */

        cbAllowGenerateDateFolder.Checked = Setting.Boolean("FILE_ALLOW_DATEFOLDER");
        cbAllowOverWrite.Checked = Setting.Boolean("FILE_ALLOW_OVERWRITE");
        cbAllowUniqueFileName.Checked = Setting.Boolean("FILE_ALLOW_UNIQUENAME");
        cbAllowAddTextToImage.Checked = Setting.Boolean("IMAGE_ALLOW_ADDTEXT");
        cbAllowResizeImage.Checked = Setting.Boolean("IMAGE_ALLOW_RESIZE");
         
    }
}